<template>
  <div class="profile">
    <!-- 我的 -->
    <van-sticky>
      <nav-bar
        style="background: var(--theme-color); color: white"
        right-width="70px"
      >
        <template #right>
          <span style="display: flex; justify-content: space-evenly">
            <i class="iconfont icon-shezhi" style="font-size: 14px"></i>
            <i class="iconfont icon-msg" style="font-size: 14px"></i>
          </span>
        </template>
      </nav-bar>
    </van-sticky>
    <div class="user-info">
      <div class="info">
        <img :src="userInfo.avatar" />
        <div class="description">
          <span>{{ userInfo.nickName }}</span>
          <div>{{ userInfo.phone }}</div>
        </div>
      </div>
      <div class="numerical">
        <div class="numerical-item">
          <span>23</span>
          <div>我的关注</div>
        </div>
        <div class="numerical-item">
          <span>66</span>
          <div>我的收藏</div>
        </div>
        <div class="numerical-item">
          <span>8</span>
          <div>浏览记录</div>
        </div>
        <div class="numerical-item">
          <span>0</span>
          <div>红包卡券</div>
        </div>
      </div>
      <div class="order-info">
        <div class="title">
          <span style="font-size: 12px; font-weight: 700">我的订单</span>
          <span
            style="color: var(--gray-moderate); font-size: 12px"
            @click="$router.push('/order')"
          >
            查看全部
            <i class="iconfont icon-xiayiye"></i>
          </span>
        </div>
        <div class="order-panel">
          <div class="order-panel-item">
            <i class="iconfont icon-qianbao"></i>
            <div>待付款</div>
          </div>
          <div class="order-panel-item">
            <i class="iconfont icon-daifahuo"></i>
            <div>待发货</div>
          </div>
          <div class="order-panel-item">
            <i class="iconfont icon-daifahuo"></i>
            <div>待收货</div>
          </div>
          <div class="order-panel-item">
            <i class="iconfont icon-pingjia"></i>
            <div>待评价</div>
          </div>
          <div class="order-panel-item">
            <i class="iconfont icon-tuihuanhuo"></i>
            <div>退换货</div>
          </div>
        </div>
      </div>
    </div>
    <div class="bg"></div>
  </div>
</template>

<script>
import { mapState } from 'vuex'
import navBar from '../../components/nav-bar/nav-bar.vue'
export default {
  components: { navBar },
  computed: {
    ...mapState(['userInfo'])
  }
}
</script>

<style scoped lang="less">
.profile {
  min-height: calc(100vh - 50px);
}
.user-info {
  background: linear-gradient(to bottom, var(--theme-color), #00d0c1, #d2f0ee);
  padding: 15px 15px 5px 15px;
  color: white;
  .info {
    display: flex;
    align-items: center;
    font-size: 14px;
    line-height: 25px;
    img {
      width: 70px;
      height: 70px;
      border-radius: 50%;
    }
    .description {
      margin-left: 15px;
    }
  }
  .numerical {
    padding: 10px 0;
    line-height: 20px;
    display: flex;
    text-align: center;
    .numerical-item {
      flex: 1;
      div {
        font-size: 12px;
      }
    }
  }
  .order-info {
    background: white;
    color: #333;
    padding: 5px 15px;
    border-radius: 10px;
    .title {
      display: flex;
      justify-content: space-between;
    }
    .order-panel {
      padding: 10px 0;
      display: flex;
      text-align: center;
      line-height: 20px;
      .order-panel-item {
        flex: 1;
        .iconfont {
          font-size: 20px;
        }
        div {
          font-size: 9px;
        }
      }
    }
  }
}
.bg {
  height: 300px;
  background-image: url(../../assets/img/service.png);
  background-size: 100% 100%;
  background-repeat: no-repeat;
}
</style>
